﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApplication4.Models;


namespace WebApplication4.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
        public ActionResult Values() {
            //ViewData["id"]= 1001;
            //TempData["code"] = "ABCF";
            //ViewBag.Age = 20;

            Model1 model = new Model1();
            var task = model.Task.ToList();
            //ViewData["Task"] = task;
            //TempData["Task"] = task;
            //ViewBag.Task = task;
            /*
             View向前传值
             1.后台传值View(数据);
            2.前台接收
             2.1 @model 数据的类型(强制类型转换)=>前台以什么样的格式进行数据解析
             2.2 Model 取值=>数据
             */
            return View(task);
        
        }
    }
}